package com.fs.ibox_h.vo;

import com.fs.ibox_h.pojo.Withdrawa;

import java.util.List;

public class Page<T> {
    private Integer currentPage;  //当前页数
    private Integer pageSize; // 页容量
    private Integer count; //总记录数
    private List<T> records; //总记录
    private Integer size; //总页码

    public Page(Integer currentPage, Integer pageSize) {
        this.currentPage = currentPage;
        this.pageSize = pageSize;
    }

    public Page() {
    }

    public Integer getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(Integer currentPage) {
        this.currentPage = currentPage;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public List<T> getRecords() {
        return records;
    }

    public void setRecords(List<T> records) {
        this.records = records;
    }

    public Integer getSize() {
        return (currentPage%pageSize)==0 ? (currentPage/pageSize) : (currentPage/pageSize) +1;
    }


    @Override
    public String toString() {
        return "Page{" +
                "currentPage=" + currentPage +
                ", pageSize=" + pageSize +
                ", count=" + count +
                ", records=" + records +
                '}';
    }
}
